package com.rent.message.controller;


import com.rent.common.entity.ResponseResult;
import com.rent.message.pojo.dto.SystemMessageDto;
import com.rent.message.service.SystemMessageService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/systemMessage")
public class SystemMessageController {


    @Autowired
    private SystemMessageService systemMessageService;

    /**
     * 发送消息给用户
     * @param dto
     * @return
     */
    @ApiOperation(value = "发送系统消息给用户")
    @PostMapping("/sendMsgToUser")
    public ResponseResult<String> sendMsgToUser(@RequestBody SystemMessageDto dto) {
        systemMessageService.sendSystemMessage(dto);
        return ResponseResult.success("发送成功");
    }

}
